//
//  UIImage+TYDrawImage.h
//  TYDemo
//
//  Created by Thank_hyu on 2020/10/28.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIImage (TYDrawImage)
/**
 Creates an `UIImage` with the attributes text.----创建属性文字图片

 @param backgroundColor The backgroundColor of image, default is [UIColor clearColor].
 @param size The size of image.If is CGSizeZero,it will return a nil image.
 @param attributesText the content of image.
 @param borderColor The border color of image.If is nil ,it will not have border of image.The border width is 1.
 @param cornerRadius The cornerRadius of image.
 */
+ (UIImage *)imageWithBackgroundColor:(UIColor * _Nullable)backgroundColor
                                 size:(CGSize)size
                       attributesText:(NSAttributedString * _Nullable)attributesText
                          borderColor:(UIColor * _Nullable)borderColor
                         cornerRadius:(CGFloat)cornerRadius;
/**
 Creates an `UIImage` with the attributes text.----创建属性文字图片

 @param backgroundColor The backgroundColor of image, default is [UIColor clearColor].
 @param size The size of image.If is CGSizeZero,it will return a nil image.
 @param attributesText the content of image.
 @param borderColor The border color of image.If is nil ,it will not have border of image.
 @param cornerRadius The corner radius of image.
 @param borderWidth The border width of image.
 */
+ (UIImage *)imageWithBackgroundColor:(UIColor * _Nullable)backgroundColor
                                 size:(CGSize)size
                       attributesText:(NSAttributedString * _Nullable)attributesText
                          borderColor:(UIColor * _Nullable)borderColor
                         cornerRadius:(CGFloat)cornerRadius
                          borderWidth:(float)borderWidth;
/**
 Creates an `UIImage` with the new size from self.----图片裁剪，获取裁剪后的图片

 @param asize The size of new image.
 */
- (UIImage *)newImageWithSize:(CGSize)asize;

/**
 Creates an `UIImage` with the data of GIF image.----根据NSData获取GIF图片

 @param data The data of GIF image.
 */
+ (UIImage *)animatedGIFWithData:(NSData *)data;

/**
 Creates an `UIImage` with add text to image.----图片添加文字水印

 @param image The added image.
 @param attributesText The content to add.
 @param point The center point of content
 */
+ (UIImage *)imageWithImage:(UIImage *)image
             attributesText:(NSAttributedString *)attributesText
           attributesCenter:(CGPoint)point;

/**
 Creates an `UIImage` from the capture screen of view.----指定UIView截屏

 @param currentView The view.
 */
+ (UIImage *)captureScreenForView:(UIView *)currentView;
/**
 Save image to photos album.----图片保存到相册
 */
- (void)saveImageToPhotosAlbum;
@end

NS_ASSUME_NONNULL_END
